<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="support.*,java.util.*"%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="layout.css" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Please Enter your address</title>
</head>
<body>
   <%
      //String country = (String)session.getAttribute("country");
      support s = new support();

      String path1 = config.getServletContext().getRealPath("countries.txt");
      Vector countries = s.getCountries(path1);

      student applicant = (student) session.getAttribute("applicant");
      applicant.setResidence(Integer.parseInt(request
            .getParameter("residence")));
      session.setAttribute("count", 0);
      String path = config.getServletContext().getRealPath(
            "majors.txt");
      applicant.setMajors(s.getMajors(path));

      session.setAttribute("applicant", applicant);
   %>
   <p>
      Name:
      <%=applicant.name.toString()%><br> Citizenship:
      <%=countries.get(applicant.getCitizenship())%><br> Residence:
      <%=countries.get(applicant.getResidence())%>
   </p>
   <hr>
   <p><b>Please enter your address:</b></p>
   <form method="POST" action="degreesLocation.jsp">
      <label for="street" class="left">Street Address:</label> <input
         type="text" name="street" /><br> <br> <label
         for="city" class="left">City:</label> <input type="text"
         name="city" /><br> <br> <label for="zipcode"
         class="left">Zip Code:</label> <input type="text"
         name="zipCode" /><br> <br>
      <%
         if (countries.get(applicant.getResidence()).equals("United States")) {
      %>
      <label for="state" class="left">State:</label><input type="text"
         name="state" /><br> <br>
      <%
         }
      %>

      <%
         if (!countries.get(applicant.getResidence()).equals("United States")) {
      %>
      <label for="countrycode" class="left">Country Code:</label><input type="text" name="teleCode" /><br> <br>
      <%
         }
      %>

      <label for="areacode" class="left">Area Code:</label> <input
         size=3 maxlength=4 type="text" name="areaCode" /><br> <br>
      <label for="phonenumber" class="left">Phone Number:</label> <input
         type="text" name="phoneNumber" /><br> <br> <input
         type="hidden" name="count" value="0"> <input
         type="submit" value="Submit" />
   </form>
</body>
</html>